#include<iostream>
#include<cmath>
using namespace std;    

int re(int x) {
    if (x <= 1) return 0;
    int sum = 1; // 1 是所有大于1的数的真约数
    int n =sqrt(x);

    for (int i = 2; i <= n; ++i) {
        if (x % i == 0) {
            sum += i;
            int other = x / i;
            if (other != i)
                sum += other;
        }
    }

    return sum;
}
	
	
int main(){
	int x,y;
	while(cin>>x>>y){
	int r1=re(x);
	int r2=re(y);
	if(r1==y||x==r2){
		cout<<"YES"<<endl;
	}
	else cout<<"NO"<<endl;}
	return 0;
}